//
//  UMSharePlatformSetting.swift
//  Runner
//
//  Created by HuiLu on 2019/12/17.
//  Copyright © 2019 The Chromium Authors. All rights reserved.
//

import Foundation

class UMSharePlatformSetting: NSObject {
    static func confitUShareSettings(){
        /*
         * 打开图片水印
         */
        //[UMSocialGlobal shareInstance].isUsingWaterMark = YES;

        /*
         * 关闭强制验证https，可允许http图片分享，但需要在info.plist设置安全域名
         <key>NSAppTransportSecurity</key>
         <dict>
         <key>NSAllowsArbitraryLoads</key>
         <true/>
         </dict>
         */
        //[UMSocialGlobal shareInstance].isUsingHttpsWhenShareContent = NO;

    }

    static func configUSharePlatforms(){
        let umManager = UMSocialManager.default();
    
        /* 设置微信的appKey和appSecret */
        umManager?.setPlaform(UMSocialPlatformType.wechatSession, appKey: "wxc9c02aafe8057275", appSecret: "023bae91eb9a5d34ea37bf74f857787f", redirectURL: "http://mobile.umeng.com/social")
        /*
         * 移除相应平台的分享，如微信收藏
         */
        umManager?.removePlatformProvider(with: UMSocialPlatformType.wechatFavorite)
        /* 设置分享到QQ互联的appID
         * U-Share SDK为了兼容大部分平台命名，统一用appKey和appSecret进行参数设置，而QQ平台仅需将appID作为U-Share的appKey参数传进即可。
        */
        umManager?.setPlaform(UMSocialPlatformType.QQ, appKey: "1106065694", appSecret: nil, redirectURL: "http://mobile.umeng.com/social")

        /* 设置新浪的appKey和appSecret */
        umManager?.setPlaform(UMSocialPlatformType.sina, appKey: "3527376685", appSecret: "62ad5185b9c829a6dabcd07dceed0ec7", redirectURL: "https://sns.whalecloud.com/sina2/callback")
    }
}
